package battleofthejavasea;

import javax.media.j3d.*;
import javax.vecmath.*;


/**
 *
 * @author Murata, Saito, Santana
 * Classe que define as luzes da cena
 */
public class BTJSLights {

    public BranchGroup getLights()
    {
        BranchGroup branchGroup = new BranchGroup();

        //Luz ambiente
        Color3f color3f = new Color3f(0.3f, 0.3f, 0.3f);
        AmbientLight ambientLight = new AmbientLight(color3f);
        BoundingSphere boundingSphere = new BoundingSphere(new Point3d(0,0,0), 100);
        ambientLight.setInfluencingBounds(boundingSphere);

        //Luzes direcionais
        Color3f color3dLight = new Color3f(0.5f, 0.5f, 0.5f);
        Vector3f vector3dLightDirect1  = new Vector3f(-3.0f, -3.0f, -3.0f);
        Vector3f vector3dLightDirect2  = new Vector3f(3.0f, -3.0f, -3.0f);
        DirectionalLight directLight1 = new DirectionalLight(color3dLight,vector3dLightDirect1);
        DirectionalLight directLight2 = new DirectionalLight(color3dLight,vector3dLightDirect2);
        directLight1.setInfluencingBounds(boundingSphere);
        directLight2.setInfluencingBounds(boundingSphere);
        branchGroup.addChild(directLight1);
        branchGroup.addChild(directLight2);
        branchGroup.addChild(ambientLight);

        return branchGroup;
    }

}
